]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Disconnect all Notification signals on NotificationMessage destruction
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 22 Sep 2015 15:27:56 +0000 (17:27 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 22 Sep 2015 16:16:16 +0000 (18:16 +0200)
The destroy signal handler is kept connected despite the NotificationMessage
being destroyed, which leaves dangling NotificationMessage objects that will
be mass destroyed when the Notification object these depend upon is finally
destroyed.

Depending on the amount of accumulated NotificationMessages, this may lead
to temporary freezes or other more funky issues when recursion limits are
hit.

https://bugzilla.gnome.org/show_bug.cgi?id=755425

js/ui/calendar.js

index b61424fc8e84b1b84263f5b0f5658e59deecdb1a..056d6e2ca57c6bca9a55f7717c027792a5ec3be9 100644 (file)
@@ -1230,7 +1230,7 @@ const NotificationMessage = new Lang.Class({
                 this._closed = true;
                 this.notification.destroy(MessageTray.NotificationDestroyedReason.DISMISSED);
             }));
-        notification.connect('destroy', Lang.bind(this,
+        this._destroyId = notification.connect('destroy', Lang.bind(this,
             function() {
                 if (!this._closed)
                     this.close();
@@ -1262,6 +1262,10 @@ const NotificationMessage = new Lang.Class({
         if (this._updatedId)
             this.notification.disconnect(this._updatedId);
         this._updatedId = 0;
+
+        if (this._destroyId)
+            this.notification.disconnect(this._destroyId);
+        this._destroyId = 0;
     }
 });